home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_2 / voyager7.exe / POSTHEX.TXT < prev    next >
Text File  |  1991-02-23  |  5KB  |  140 lines

  1. Included in this posting are two simple routines, ->HEX and HEX->.
  2. These routines are very similar to Bill Wickes' ->ASC and ASC->, in fact
  3. they are stripped-down versions of ->ASC and ASC->.
  4.  
  5. The differences are:
  6.  
  7. * No checksums are involved.  This means you can 'create' objects
  8.   without having to figure out the checksum.
  9.  
  10. * No line-feeds.  This means you don't have to figure out where they
  11.   go.
  12.  
  13. * Because no checksums are needed, be careful!  Actually providing a
  14.   checksum can cause a Memory Lost - maybe not imeadiatly, but soon
  15.   after Garbage Collection.
  16.  
  17. * Do not include line-feeds, they can/will cause problems.
  18.  
  19. * For the most part these routines are for creating fairly small
  20.   objects, but can be used for larger objects.
  21.  
  22. * Also: these routines are for 'development'.  When you're all done
  23.   building your program/object, use ->ASC to post it (please!)
  24.  
  25. * Any other differences are totally a figment of you imagination.
  26.  
  27. Contained below are Voyager listings and ->ASC strings for these
  28. routines.
  29.  
  30.         Derek S. Nickel
  31.  
  32. ------------------------------------------------------------
  33. 80000: ; *** ->HEX ***
  34. 80000: 02D9D ! Program
  35. 80005: 1592D ; Clear current command and verify DEPTH >= 1
  36. 8000A: 03188 ; Internal DUP
  37. 8000F: 05944 ; Internal BYTES (non-ROM objects) -> (2:System Binary,1:Binary Integer)
  38. 80014: 03244 ; Internal DROP
  39. 80019: 055DF ; ""
  40. 8001E: 032C2 ; Internal OVER
  41. 80023: 03E6F ; Internal multiply by 2 (1:System Binary)
  42. 80028: 61C1C ; allocate nibbles (2:sized object,1:System Binary)
  43. 8002D: 03223 ; Internal SWAP
  44. 80032: 02DCC ! Code
  45. 80037: 00065 ! 101 nibbles (next RPL at 8009C)
  46. 8003C: 8F14660    GOSBVL 06641          ; MC: pop stk1 (System Binary)
  47.                                         ; into A.A
  48. 80043: CC         A=A-1  A
  49. 80045: 8FB9760    GOSBVL 0679B          ; MC: save D0,D1,B,D (uses
  50.                                         ; C,D0), clear carry
  51. 8004C: D8         B=A    A
  52. 8004E: 143        A=DAT1 A
  53. 80051: 130        D0=A
  54. 80054: 169        D0=D0+ 10
  55. 80057: 174        D1=D1+ 5
  56. 8005A: 143        A=DAT1 A
  57. 8005D: 131        D1=A
  58. 80060: AE2        C=0    B
  59. 80063: 15F0       C=DAT1 1
  60. 80067: 8082103    LAHEX  30             ! "0"
  61. 8006E: A62        C=C+A  B
  62. 80071: 8082193    LAHEX  39             ! "9"
  63. 80078: 9EEC0      ?A>=C  B
  64.           GOYES  80087
  65. 8007D: 8082170    LAHEX  07             ! "."
  66. 80084: A62        C=C+A  B
  67. 80087: 14C        DAT0=C B
  68. 8008A: 161        D0=D0+ 2
  69. 8008D: 170        D1=D1+ 1
  70. 80090: CD         B=B-1  A
  71. 80092: 5DC        GONC   80060
  72. 80095: 8D34150    GOVLNG 05143          ; MC: restore D,B,D1,D0 (C=D0),
  73.                                         ; clear carry and continue RPL
  74.  . . . . . . ! End of Code
  75. 8009C: 60F9B ; drop level two object
  76. 800A1: 0312B ! End Marker
  77.  
  78. %%HP: T(3)A(R)F(.);
  79. "D9D20D2951881304495044230FD5502C230F6E30C1C1632230CCD20560008F14
  80. 660CC8FB9760D8143130169174143131AE215F08082103A6280821939EEC0808
  81. 2170A6214C161170CD5DC8D34150B9F06B2130D91B"
  82.  
  83. ------------------------------------------------------------
  84. 80000: ; *** HEX-> ***
  85. 80000: 02D9D ! Program
  86. 80005: 1592D ; Clear current command and verify DEPTH >= 1
  87. 8000A: 18FB2 ; Check arguments for type
  88. 8000F: 0400D ; <3h>
  89. 80014: 02D9D ! Program
  90. 80019: 03188 ; Internal DUP
  91. 8001E: 05636 ; Internal SIZE (bytes) (1:String) -> System Binary
  92. 80023: 055DF ; ""
  93. 80028: 032C2 ; Internal OVER
  94. 8002D: 61C1C ; allocate nibbles (2:sized object,1:System Binary)
  95. 80032: 03223 ; Internal SWAP
  96. 80037: 02DCC ! Code
  97. 8003C: 00070 ! 112 nibbles (next RPL at 800AC)
  98. 80041: 8F14660    GOSBVL 06641          ; MC: pop stk1 (System Binary)
  99.                                         ; into A.A
  100. 80048: CC         A=A-1  A
  101. 8004A: 8FB9760    GOSBVL 0679B          ; MC: save D0,D1,B,D (uses
  102.                                         ; C,D0), clear carry
  103. 80051: D8         B=A    A
  104. 80053: 143        A=DAT1 A
  105. 80056: 130        D0=A
  106. 80059: 169        D0=D0+ 10
  107. 8005C: 132        AD0EX
  108. 8005F: 130        D0=A
  109. 80062: 141        DAT1=A A
  110. 80065: 174        D1=D1+ 5
  111. 80068: 143        A=DAT1 A
  112. 8006B: 131        D1=A
  113. 8006E: 179        D1=D1+ 10
  114. 80071: AE2        C=0    B
  115. 80074: 14F        C=DAT1 B
  116. 80077: 8082103    LAHEX  30             ! "0"
  117. 8007E: B62        C=C-A  B
  118. 80081: 8082190    LAHEX  09             ! "."
  119. 80088: 9EEB0      ?A>=C  B
  120.           GOYES  80096
  121. 8008D: 808207     LAHEX  7
  122. 80093: B62        C=C-A  B
  123. 80096: 15C0       DAT0=C 1
  124. 8009A: 160        D0=D0+ 1
  125. 8009D: 171        D1=D1+ 2
  126. 800A0: CD         B=B-1  A
  127. 800A2: 5EC        GONC   80071
  128. 800A5: 8D34150    GOVLNG 05143          ; MC: restore D,B,D1,D0 (C=D0),
  129.                                         ; clear carry and continue RPL
  130.  . . . . . . ! End of Code
  131. 800AC: 60F9B ; drop level two object
  132. 800B1: 0312B ! End Marker
  133. 800B6: 0312B ! End Marker
  134.  
  135. %%HP: T(3)A(R)F(.);
  136. "D9D20D29512BF81D0040D9D208813063650FD5502C230C1C1632230CCD200700
  137. 08F14660CC8FB9760D8143130169132130141174143131179AE214F8082103B6
  138. 280821909EEB0808207B6215C0160171CD5EC8D34150B9F06B2130B21308086"
  139.  
  140.